/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 800px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
    margin-top: 36px;
}

.header h2 {
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
}

.header p {
    color: #7f8c8d;
}

.upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #3498db;
}

.btn {
    background: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-section {
    margin-top: 30px;
}

.result-image {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.result-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.confidence-meter {
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    width: 0%;
    transition: width 1s;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
}


/* 新增标签页样式 */
.tab-container {
    display: flex;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background: #f1f1f1;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s;
}

.tab.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 批量识别结果样式 */
.batch-results {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.result-item:hover {
    background: #f8f9fa;
}

.result-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 5px;
}

.result-info {
    flex-grow: 1;
}

/* 导出按钮样式 */
.export-btn {
    margin-top: 20px;
    background: #27ae60;
}

.export-btn:hover {
    background: #219653;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 摄像头界面样式 */
.camera-view {
    width: 100%;
    max-width: 640px;
    border: 2px solid #3498db;
    border-radius: 8px;
    margin: 0 auto 20px;
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.capture-btn {
    background: #e74c3c;
}

.capture-btn:hover {
    background: #c0392b;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .result-item {
        flex-direction: column;
        text-align: center;
    }
    
    .result-item img {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 14px;
    }
}